module	BKP_TXBUFF(
   input                         GTM_RESET,

   input                         TXBUFF_IN_WR_CLK,
   input[15:0]                   TXBUFF_IN_WR_DATA,

   input                         TXBUFF_IN_RD_CLK,
   output[15:0]                  TXBUFF_OUT_RD_DATA
   );

reg[4:0]                         txbuff_write_cnt32;
reg[4:0]                         txbuff_read_cnt32;

always @(posedge GTM_RESET or posedge TXBUFF_IN_WR_CLK) begin
   if (GTM_RESET==1'b1)
      txbuff_write_cnt32[4:0]                  <= 5'd0;
   else
      txbuff_write_cnt32[4:0]                  <= txbuff_write_cnt32[4:0] +5'd1;
end

always @(posedge GTM_RESET or posedge TXBUFF_IN_RD_CLK) begin
   if (GTM_RESET==1'b1)
      txbuff_read_cnt32[4:0]                   <= 5'd16;
   else
      txbuff_read_cnt32[4:0]                   <= txbuff_read_cnt32[4:0] +5'd1;
end


BKP_XLNX_RAM512_16_16            INST_TXBUFF(
   .a                            (txbuff_write_cnt32[4:0]),
   .d                            (TXBUFF_IN_WR_DATA[15:0]),
   .dpra                         (txbuff_read_cnt32[4:0]),
   .clk                          (TXBUFF_IN_WR_CLK),
   .we                           (1'b1),
   .qdpo_clk                     (TXBUFF_IN_RD_CLK),
   .qdpo                         (TXBUFF_OUT_RD_DATA[15:0])
   );
endmodule

